
export function date_with_timestamp(timestamp: number) {
    const date = new Date(timestamp * 1000);
    const year = date.getFullYear();
    const month = date.getMonth() + 1;
    const day = date.getDate();
    const hour = date.getHours();
    const minute = date.getMinutes();
    const sec = date.getSeconds();
    return `${year}-${month}-${day} ${hour}:${minute}:${sec}`;
}

export function delay(ms: number) {
    return new Promise<void>((resolve, _) => {
        setTimeout(resolve, ms);
    });
}
